package org.jeecg.modules.wms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.wms.entity.WmsInboundOrderDetail;

import java.util.List;

/**
 * 入库单明细Mapper接口
 */
public interface WmsInboundOrderDetailMapper extends BaseMapper<WmsInboundOrderDetail> {
    
    /**
     * 根据入库单ID查询明细列表
     * 
     * @param inboundOrderId 入库单ID
     * @return 明细列表
     */
    List<WmsInboundOrderDetail> selectByInboundOrderId(@Param("inboundOrderId") String inboundOrderId);
    
    /**
     * 批量插入入库单明细
     * 
     * @param details 明细列表
     * @return 影响行数
     */
    int batchInsert(@Param("details") List<WmsInboundOrderDetail> details);
    
    /**
     * 删除入库单明细
     * 
     * @param inboundOrderId 入库单ID
     * @return 影响行数
     */
    int deleteByInboundOrderId(@Param("inboundOrderId") String inboundOrderId);
    
    /**
     * 更新入库单明细
     * 
     * @param detail 明细信息
     * @return 影响行数
     */
    int updateDetail(@Param("detail") WmsInboundOrderDetail detail);

    List<WmsInboundOrderDetail> selectByInboundOrderIdAndUpdateBy(@Param("inboundOrderId") String inboundOrderId,@Param("username") String username);
}